package com.ruanyun.modular.admin.service;

import cn.stylefeng.roses.core.reqres.response.ResponseData;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruanyun.base.pojo.page.LayuiPageInfo;
import com.ruanyun.modular.admin.entity.TBasicMaterial;
import com.ruanyun.modular.admin.model.params.TBasicMaterialParam;
import com.ruanyun.modular.admin.model.result.TBasicMaterialResult;
import com.baomidou.mybatisplus.extension.service.IService;
import io.swagger.models.auth.In;

import java.util.List;

/**
 * <p>
 * 主要原辅料 服务类
 * </p>
 *
 * @author zs
 * @since 2021-04-16
 */
public interface TBasicMaterialService extends IService<TBasicMaterial> {

    /**
     * 新增
     *
     * @author zs
     * @Date 2021-04-16
     */
    ResponseData add(TBasicMaterialParam param);

    /**
     * 删除
     *
     * @author zs
     * @Date 2021-04-16
     */
    void delete(TBasicMaterialParam param);

    /**
    * 删除
    * @param id
    * @return
    */
    ResponseData updateDelFlagById(Long id);

    /**
     * 更新
     *
     * @author zs
     * @Date 2021-04-16
     */
    ResponseData update(TBasicMaterialParam param);

    /**
     * 查询单条数据，Specification模式
     *
     * @author zs
     * @Date 2021-04-16
     */
    TBasicMaterialResult findBySpec(TBasicMaterialParam param);

    /**
     * 查询列表，Specification模式
     *
     * @author zs
     * @Date 2021-04-16
     */
    List<TBasicMaterialResult> findListBySpec(TBasicMaterialParam param);

    /**
     * 查询分页数据，Specification模式
     *
     * @author zs
     * @Date 2021-04-16
     */
     LayuiPageInfo findPageBySpec(TBasicMaterialParam param);

     /**
     * 启用
     *
     * @param id
     * @return
     */
     ResponseData enableById(Long id);

     /**
     * 禁用
     *
     * @param id
     * @return
     */
     ResponseData disableById(Long id);

     TBasicMaterial getDetail(Long id);

     /*根据企业id获取分页数据*/
    Page<TBasicMaterialResult> getMateriaPage(Integer companyId);


    List<TBasicMaterialResult> getMaterList(Integer companyId);

}
